<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>盒子模型</title>
    <style type="text/css">
        #box{
            width: 120px;
            height: 120px;
            padding: 5px;
            margin: 10px;
            border: 1px solid red;
            box-sizing: border-box;
        }
        #f{
            width: 50px;
            height: 50px;
            border: 1px solid blue;
            /*box-sizing: border-box; !*盒子的高度和宽度就是内容元素的高度和宽度*!*/
            /*box-sizing: content-box; !*默认值，盒子的总尺寸*!*/
            box-sizing: inherit; /*继承父类的盒子尺寸类型*/
        }
    </style>
</head>
<body>
    <div id="box">
        <div id="f"></div>
    </div>
</body>
</html>